package com.example;


import com.example.service.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class TeacherController {

    @Autowired
    private TeacherService teacherService;

    @GetMapping("/Teacher")
    public String getAllTeachers(Model model) {
        model.addAttribute("teacherList", teacherService.getAllTeachers());
        return "Teacher";
    }
}